package com.one.service.impl;

import com.one.mapper.RateDailyRecordMapper;
import com.one.pojo.RateDailyRecord;
import com.one.service.RateDailyRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @Author semstouch
 * @Date 2017/4/12
 **/
@Service
public class RateDailyRecordServiceImpl implements RateDailyRecordService {
    @Resource
    private RateDailyRecordMapper rateDailyRecordMapper;
    @Override
    public int countNum(String userId) {
        return rateDailyRecordMapper.countNum(userId);
    }

    @Override
    public List<RateDailyRecord> findByUserId(String userId, int numPerPage, int currentPage) {
        int start = 0;
        start = (currentPage - 1) * numPerPage;
        return rateDailyRecordMapper.findByUserId(userId,start,numPerPage);
    }
}
